﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SRM.DataObjects;
using System.Data;

public partial class RequisitionView2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.QueryString["pos"] == null)
                Response.Redirect("RequisitionListing2.aspx");

            DataTable dtRequisition = SRM_Requisition.GetRequisition(Request.QueryString["pos"].Trim());

            if (dtRequisition.Rows.Count <= 0)
                Response.Redirect("RequisitionListing2.aspx");
            
            lblTitle.Text = dtRequisition.Rows[0]["JobTitleFreeText"].ToString();            
        }
    }

    protected void btnApply_Click(object sender, EventArgs e)
    {
        //string strParam = "AppList|" + Request.QueryString["reqid"].Trim() + "|KEPPELLANDINTERNATIONALLTD";
        //strParam = CryptoUtil.Encrypt(strParam)

        Response.Redirect(string.Format("ApplicantForm.aspx?pos={0}", Request.QueryString["pos"].Trim()));

        //)
        //"ApplicantForm.aspx?pos=" + Request.QueryString["pos"].Replace("&", "%26") + "&param=" + strParam, false);

    }
}